home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-10 | 45.6 KB | 1,195 lines | [TEXT/MPS ] |
- (*
- File: OCE.mod
-
- Contains: Apple Open Collaboration Environment (AOCE) Interfaces.
-
- Version: Technology: AOCE Toolbox 1.02
- Package: Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs.applelink.apple.com
- AppleLink: APPLE.BUGS
-
- *)
-
- (*$TAGS-*)
- (*$CALLING PASCAL*)
- MODULE OCE;
-
- IMPORT SYSTEM, Types, Aliases, AppleEvents;
-
- (* $PUSH*)
- (* $ALIGN MAC68K*)
- (* $LibExport+*)
-
- CONST
- kOCECopyCreationID* = 768;
- kOCECopyDirDiscriminator* = 769;
- kOCECopyLocalRecordID* = 770;
- kOCECopyPackedDSSpec* = 771;
- kOCECopyPackedPathName* = 772;
- kOCECopyPackedRLI* = 773;
- kOCECopyPackedRecordID* = 774;
- kOCECopyRLI* = 775;
- kOCECopyRString* = 776;
- kOCECopyRecordID* = 777;
- kOCECopyShortRecordID* = 778;
- kOCEDuplicateRLI* = 779;
- kOCEEqualCreationID* = 780;
- kOCEEqualDirDiscriminator* = 781;
- kOCEEqualDSSpec* = 782;
- kOCEEqualLocalRecordID* = 783;
- kOCEEqualPackedDSSpec* = 784;
- kOCEEqualPackedPathName* = 785;
- kOCEEqualPackedRecordID* = 786;
- kOCEEqualPackedRLI* = 787;
- kOCEEqualRecordID* = 788;
- kOCEEqualRLI* = 789;
- kOCEEqualRString* = 790;
- kOCEEqualShortRecordID* = 791;
- kOCEExtractAlias* = 792;
- kOCEGetDSSpecInfo* = 793;
- kOCEGetIndAttributeType* = 794;
- kOCEGetIndRecordType* = 795;
- kOCEGetXtnType* = 796;
- kOCEIsNullPackedPathName* = 797;
- kOCENewLocalRecordID* = 798;
- kOCENewRLI* = 799;
- kOCENewRecordID* = 800;
- kOCENewShortRecordID* = 801;
- kOCEPackDSSpec* = 802;
- kOCEPackPathName* = 803;
- kOCEPackRLI* = 804;
- kOCEPackRLIParts* = 805;
- kOCEPackRecordID* = 806;
- kOCEPackedDSSpecSize* = 807;
- kOCEPackedPathNameSize* = 808;
- kOCEPackedRLIPartsSize* = 809;
- kOCEPackedRLISize* = 810;
- kOCEPackedRecordIDSize* = 811;
- kOCEDNodeNameCount* = 812;
- kOCERelRString* = 813;
- kOCESetCreationIDtoNull* = 814;
- kOCEUnpackDSSpec* = 815;
- kOCEUnpackPathName* = 816;
- kOCEUnpackRLI* = 817;
- kOCEUnpackRecordID* = 818;
- kOCEValidPackedDSSpec* = 819;
- kOCEValidPackedPathName* = 820;
- kOCEValidPackedRecordID* = 821;
- kOCEValidPackedRLI* = 822;
- kOCEValidRLI* = 823;
- kOCEValidRString* = 824;
- kOCECToRString* = 825;
- kOCEPToRString* = 826;
- kOCERToPString* = 827;
- kOCEPathFinderCID* = 828;
- kOCEStreamPackedDSSpec* = 829;
- kOCENullCID* = 836;
- kOCEGetAccessControlDSSpec* = 837;
- kOCEGetRootPackedRLI* = 838;
-
-
- TYPE
- OCERecordTypeIndex* = INTEGER;
-
- OCEAttributeTypeIndex* = INTEGER;
-
- (* For anyone who absolutely needs a define of the body of the standard record or
- attribute type, use these below. CAUTION! All the types below are assumed to be
- in character set 'smRoman'. If you try to compare these to some RString or
- AttributeType variable, you must take the character set code into account. Future
- standard types may be defined using character sets other than 'smRoman'. *)
-
- CONST
- kUserRecTypeNum* = 1; (* "User" *)
- kGroupRecTypeNum* = 2; (* "Group" *)
- kMnMRecTypeNum* = 3; (* "AppleMail™ M&M" *)
- kMnMForwarderRecTypeNum* = 4; (* "AppleMail™ Fwdr" *)
- kNetworkSpecRecTypeNum* = 5; (* "NetworkSpec" *)
- kADAPServerRecTypeNum* = 6; (* "ADAP Server" *)
- kADAPDNodeRecTypeNum* = 7; (* "ADAP DNode" *)
- kADAPDNodeRepRecTypeNum* = 8; (* "ADAP DNode Rep" *)
- kServerSetupRecTypeNum* = 9; (* "Server Setup" *)
- kDirectoryRecTypeNum* = 10; (* "Directory" *)
- kDNodeRecTypeNum* = 11; (* "DNode" *)
- kSetupRecTypeNum* = 12; (* "Setup" *)
- kMSAMRecTypeNum* = 13; (* "MSAM" *)
- kDSAMRecTypeNum* = 14; (* "DSAM" *)
- kAttributeValueRecTypeNum* = 15; (* "Attribute Value" *)
- kBusinessCardRecTypeNum* = 16; (* "Business Card" *)
- kMailServiceRecTypeNum* = 17; (* "Mail Service" *)
- kCombinedRecTypeNum* = 18; (* "Combined" *)
- kOtherServiceRecTypeNum* = 19; (* "Other Service" *)
- kAFPServiceRecTypeNum* = 20; (* "Other Service afps" *)
- kFirstOCERecTypeNum* = kUserRecTypeNum; (* first standard OCE record type *)
- kLastOCERecTypeNum* = kAFPServiceRecTypeNum; (* last standard OCE record type *)
- kNumOCERecTypes* = kLastOCERecTypeNum - kFirstOCERecTypeNum + 1;
-
- (* Indices for the standard definitions for certain attribute types (OCEAttributeTypeIndex): *)
- kMemberAttrTypeNum* = 1001; (* "Member" *)
- kAdminsAttrTypeNum* = 1002; (* "Administrators" *)
- kMailSlotsAttrTypeNum* = 1003; (* "mailslots" *)
- kPrefMailAttrTypeNum* = 1004; (* "pref mailslot" *)
- kAddressAttrTypeNum* = 1005; (* "Address" *)
- kPictureAttrTypeNum* = 1006; (* "Quickdraw.Picture" *)
- kAuthKeyAttrTypeNum* = 1007; (* "auth key" *)
- kTelephoneAttrTypeNum* = 1008; (* "Telephone" *)
- kNBPNameAttrTypeNum* = 1009; (* "NBP Name" *)
- kQMappingAttrTypeNum* = 1010; (* "ForwarderQMap" *)
- kDialupSlotAttrTypeNum* = 1011; (* "DialupSlotInfo" *)
- kHomeNetAttrTypeNum* = 1012; (* "Home Internet" *)
- kCoResAttrTypeNum* = 1013; (* "Co-resident M&M" *)
- kFwdrLocalAttrTypeNum* = 1014; (* "FwdrLocalRecord" *)
- kConnectAttrTypeNum* = 1015; (* "Connected To" *)
- kForeignAttrTypeNum* = 1016; (* "Foreign RLIs" *)
- kOwnersAttrTypeNum* = 1017; (* "Owners" *)
- kReadListAttrTypeNum* = 1018; (* "ReadList" *)
- kWriteListAttrTypeNum* = 1019; (* "WriteList" *)
- kDescriptorAttrTypeNum* = 1020; (* "Descriptor" *)
- kCertificateAttrTypeNum* = 1021; (* "Certificate" *)
- kMsgQsAttrTypeNum* = 1022; (* "MessageQs" *)
- kPrefMsgQAttrTypeNum* = 1023; (* "PrefMessageQ" *)
- kMasterPFAttrTypeNum* = 1024; (* "MasterPF" *)
- kMasterNetSpecAttrTypeNum* = 1025; (* "MasterNetSpec" *)
- kServersOfAttrTypeNum* = 1026; (* "Servers Of" *)
- kParentCIDAttrTypeNum* = 1027; (* "Parent CID" *)
- kNetworkSpecAttrTypeNum* = 1028; (* "NetworkSpec" *)
- kLocationAttrTypeNum* = 1029; (* "Location" *)
- kTimeSvrTypeAttrTypeNum* = 1030; (* "TimeServer Type" *)
- kUpdateTimerAttrTypeNum* = 1031; (* "Update Timer" *)
- kShadowsOfAttrTypeNum* = 1032; (* "Shadows Of" *)
- kShadowServerAttrTypeNum* = 1033; (* "Shadow Server" *)
- kTBSetupAttrTypeNum* = 1034; (* "TB Setup" *)
- kMailSetupAttrTypeNum* = 1035; (* "Mail Setup" *)
- kSlotIDAttrTypeNum* = 1036; (* "SlotID" *)
- kGatewayFileIDAttrTypeNum* = 1037; (* "Gateway FileID" *)
- kMailServiceAttrTypeNum* = 1038; (* "Mail Service" *)
- kStdSlotInfoAttrTypeNum* = 1039; (* "Std Slot Info" *)
- kAssoDirectoryAttrTypeNum* = 1040; (* "Asso. Directory" *)
- kDirectoryAttrTypeNum* = 1041; (* "Directory" *)
- kDirectoriesAttrTypeNum* = 1042; (* "Directories" *)
- kSFlagsAttrTypeNum* = 1043; (* "SFlags" *)
- kLocalNameAttrTypeNum* = 1044; (* "Local Name" *)
- kLocalKeyAttrTypeNum* = 1045; (* "Local Key" *)
- kDirUserRIDAttrTypeNum* = 1046; (* "Dir User RID" *)
- kDirUserKeyAttrTypeNum* = 1047; (* "Dir User Key" *)
- kDirNativeNameAttrTypeNum* = 1048; (* "Dir Native Name" *)
- kCommentAttrTypeNum* = 1049; (* "AIFF.Comment" *)
- kRealNameAttrTypeNum* = 1050; (* "Real Name" *)
- kPrivateDataAttrTypeNum* = 1051; (* "Private Data" *)
- kDirTypeAttrTypeNum* = 1052; (* "Directory Type" *)
- kDSAMFileAliasAttrTypeNum* = 1053; (* "DSAM File Alias" *)
- kCanAddressToAttrTypeNum* = 1054; (* "Can Address To" *)
- kDiscriminatorAttrTypeNum* = 1055; (* "Discriminator" *)
- kAliasAttrTypeNum* = 1056; (* "Alias" *)
- kParentMSAMAttrTypeNum* = 1057; (* "Parent MSAM" *)
- kParentDSAMAttrTypeNum* = 1058; (* "Parent DSAM" *)
- kSlotAttrTypeNum* = 1059; (* "Slot" *)
- kAssoMailServiceAttrTypeNum* = 1060; (* "Asso. Mail Service" *)
- kFakeAttrTypeNum* = 1061; (* "Fake" *)
- kInheritSysAdminAttrTypeNum* = 1062; (* "Inherit SysAdministrators" *)
- kPreferredPDAttrTypeNum* = 1063; (* "Preferred PD" *)
- kLastLoginAttrTypeNum* = 1064; (* "Last Login" *)
- kMailerAOMStateAttrTypeNum* = 1065; (* "Mailer AOM State" *)
- kMailerSendOptionsAttrTypeNum* = 1066; (* "Mailer Send Options" *)
- kJoinedAttrTypeNum* = 1067; (* "Joined" *)
- kUnconfiguredAttrTypeNum* = 1068; (* "Unconfigured" *)
- kVersionAttrTypeNum* = 1069; (* "Version" *)
- kLocationNamesAttrTypeNum* = 1070; (* "Location Names" *)
- kActiveAttrTypeNum* = 1071; (* "Active" *)
- kDeleteRequestedAttrTypeNum* = 1072; (* "Delete Requested" *)
- kGatewayTypeAttrTypeNum* = 1073; (* "Gateway Type" *)
- kFirstOCEAttrTypeNum* = kMemberAttrTypeNum; (* first standard OCE attr type *)
- kLastOCEAttrTypeNum* = kGatewayTypeAttrTypeNum; (* last standard OCE attr type *)
- kNumOCEAttrTypes* = kLastOCEAttrTypeNum - kFirstOCEAttrTypeNum + 1;
-
- (* Miscellaneous enums*: *)
- kRString32Size* = 32; (* max size of the body field in RString32 *)
- kRString64Size* = 64; (* max size of the body field in RString64 *)
- kNetworkSpecMaxBytes* = 32; (* max size of the body field in NetworkSpec *)
- kPathNameMaxBytes* = 1024; (* max size of the data field in PackedPathName *)
- kDirectoryNameMaxBytes* = 32; (* max size of the body field in DirectoryName *)
- kAttributeTypeMaxBytes* = 32; (* max size of the body field in AttributeType *)
- kAttrValueMaxBytes* = 65536; (* max size of any attribute value *)
- kRStringMaxBytes* = 256; (* max size (in bytes) of the body field of a recordName or recordType *)
- kRStringMaxChars* = 128; (* max size (in chars) of the body field of a recordName or recordType *)
-
- kNULLDNodeNumber* = 0; (* Special value meaning none specified *)
- kRootDNodeNumber* = 2; (* DNodeNum corresponding to the root of the tree *)
-
- (* This enum is used to select the kind of RString in calls such as OCERelRString,
- OCEEqualRString, and OCEValidRString.
-
- eGenericSensitive and eGenericInsensitive are enumerators that can be used if you
- use RStrings for things other than what you see in this file. If you want them to
- be compared in a case- and diacritical-sensitive manner (c ≠ C ≠ ç), use
- eGenericSensitive. If you want them to be compared in a case- and diacritical-
- insensitive manner (c* = C* = ç), use eGenericInensitive.
- WARNING: do not use eGenericSensitive and eGenericInsensitive with catalog
- names, entity names, pathname parts, entity types, network specs, or attribute
- types! Don't assume that you know how they should be compared!!! *)
- kOCEDirName* = 0;
- kOCERecordOrDNodeName* = 1;
- kOCERecordType* = 2;
- kOCENetworkSpec* = 3;
- kOCEAttrType* = 4;
- kOCEGenericSensitive* = 5;
- kOCEGenericInsensitive* = 6;
-
-
- TYPE
- RStringKind* = INTEGER;
-
- (* Values for the signature field in Discriminator *)
-
- CONST
- kDirAllKinds* = 0;
- kDirADAPKind* = LONG("adap");
- kDirPersonalDirectoryKind* = LONG("pdir");
- kDirDSAMKind* = LONG("dsam");
-
-
- TYPE
- OCEDirectoryKind* = LONGINT;
-
- (* Values returned by GetDSSpecInfo() *)
-
- CONST
- kOCEInvalidDSSpec* = $3F3F3F3F; (* could not be determined *)
- kOCEDirsRootDSSpec* = LONG("root"); (* root of all catalogs ("Catalogs" icon) *)
- kOCEDirectoryDSSpec* = LONG("dire"); (* catalog *)
- kOCEDNodeDSSpec* = LONG("dnod"); (* d-node *)
- kOCERecordDSSpec* = LONG("reco"); (* record *)
- kOCEentnDSSpec* = LONG("entn"); (* extensionType is LONG("entn") *)
- kOCENOTentnDSSpec* = LONG("not ");
-
- (* Values for AttributeTag *)
- typeRString* = LONG("rstr");
- typePackedDSSpec* = LONG("dspc");
- typeBinary* = LONG("bnry");
-
- (* Bit flag corresponding to the canContainRecords bit. Use it like this*:
- if (foo & kCanContainRecords)
- then this dNode can contain records!
- kForeignNode is used to indicate nodes in the name hierarchy that correspond to
- foreign catalogs (meaning ADAP sees no clusters or DNodes beneath it, but
- mail routers might be able to route to clusters beneath it. *)
- kCanContainRecordsBit* = 0;
- kForeignNodeBit* = 1;
-
- (* DirNodeKind *)
- kCanContainRecords* = ASH(1,kCanContainRecordsBit);
- kForeignNode* = ASH(1,kForeignNodeBit);
-
-
- TYPE
- DirNodeKind* = LONGINT;
-
- (**** Toolbox Control ****)
- (* We will have a version number and attributes for toolboxes off the aa5e trap
- and the S&F server trap.
-
- This includes the OCE toolbox and S&F Server. [Note: the S&F server will
- change to ONLY service ServerGateway calls —it will then be necessary to run
- it co–resident with an OCE toolbox].
-
- The high order word will represent the S&F Server version number. The low
- order word will represent the OCE toolbox version number. These will be zero
- until the component is up and running. It is not possible to know these
- a–priori. Note*: there will not be a seperate version numbers for each component
- in the OCE toolbox or S&F server.
-
- The above is consistent with the standard System 7.0 usage of Gestalt.
-
- The oce tb attribute gestaltOCETBPresent implies the existence of OCE on a
- machine.
-
- The OCE TB attribute gestaltOCETBAvailable implies the availablity of OCE calls.
-
- The attribute gestaltOCESFServerAvailable implies the availablity of OCE calls
- available through the S&F server. This are essentially the server gateway calls.
-
- Any (future) remaining OCE attributes may not be established correctly until
- the attribute gestaltOCETBAvailable is set.
-
- The gestalt selectors and values are listed below*: *)
-
- CONST
- gestaltOCEToolboxVersion* = LONG("ocet"); (* OCE Toolbox version *)
- gestaltOCEToolboxAttr* = LONG("oceu");
-
- (* version includes*:
- * dirtb
- * authtb
- * mailtb
- * ipmtb
- * personal catalog
- * ADSPSecure
- * e.g. all interfaces dependent on the aa5e trap. *)
- gestaltOCETB* = $0102; (* OCE Toolbox version 1.02 *)
- gestaltSFServer* = $0100; (* S&F Server version 1.0 *)
- gestaltOCETBPresent* = $01; (* OCE toolbox is present, not running *)
- gestaltOCETBAvailable* = $02; (* OCE toolbox is running and available *)
- gestaltOCESFServerAvailable* = $04; (* S&F Server is running and available *)
- gestaltOCETBNativeGlueAvailable* = $10; (* Native PowerPC Glue routines are availible *)
-
- (* Constants used for Transitions. *)
- ATTransIPMStart* = LONG("ipms");
- ATTransIPMShutdown* = LONG("ipmd");
- ATTransDirStart* = LONG("dirs");
- ATTransDirShutdown* = LONG("dird");
- ATTransAuthStart* = LONG("auts");
- ATTransAuthShutdown* = LONG("autd");
- ATTransSFStart* = LONG("s&fs");
- ATTransSFShutdown* = LONG("s&fd");
-
- (* Some definitions for time-related parameters*: *)
- (* Interpreted as UTC seconds since 1/1/1904 *)
-
- TYPE
- UTCTime* = LONGINT;
-
- (* seconds EAST of Greenwich *)
- UTCOffset* = LONGINT;
-
- (* This is the same as the ScriptManager script. *)
- CharacterSet* = INTEGER;
-
- (**** RString ****)
- (* struct RString is a maximum-sized structure. Allocate one of these and it will
- hold any valid RString. *)
- RString* = RECORD
- charSet*: CharacterSet;
- dataLength*: INTEGER;
- body*: ARRAY (*ΔΔ[0..*)kRStringMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *) (* place for characters *)
- END;
-
- (* struct ProtoRString is a minimum-sized structure. Use this for a variable-length RString. *)
- ProtoRString* = RECORD
- charSet*: CharacterSet;
- dataLength*: INTEGER;
- END;
-
- RStringPtr* = POINTER TO RString;
- RStringHandle* = HANDLE TO RString (*ΔΔ POINTER TO RStringPtr*);
-
- ProtoRStringPtr* = POINTER TO ProtoRString;
-
- RString64* = RECORD
- charSet*: CharacterSet;
- dataLength*: INTEGER;
- body*: ARRAY (*ΔΔ[0..*)kRString64Size(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
- END;
-
- RString32* = RECORD
- charSet*: CharacterSet;
- dataLength*: INTEGER;
- body*: ARRAY (*ΔΔ[0..*)kRString32Size(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
- END;
-
- (* Standard definitions for the entity type field and attribute type
- have been moved to the end of the file. *)
- (* Copies str1 to str2. str2Length is the size of str2, excluding header.
- A memFull error will be returned if that is not as large as str1->dataLength. *)
-
- PROCEDURE OCECopyRString*((*CONST*)VAR str1: RString; VAR str2: RString; str2Length: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 776, $AA5C;
- (*$END*)
- (* Make an RString from a C string. If the c string is bigger than rStrLength,
- only rStrLength bytes will be copied. (rStrLength does not include the header size) *)
- PROCEDURE OCECToRString*(cStr: Types.ConstCStringPtr; charSet: CharacterSet; VAR rStr: RString; rStrLength: INTEGER);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 825, $AA5C;
- (*$END*)
- (* Make an RString from a Pascal string. If the Pascal string is bigger than rStrLength,
- only rStrLength bytes will be copied. (rStrLength does not include the header size) *)
- PROCEDURE OCEPToRString*(pStr: Types.ConstStr255Param; charSet: CharacterSet; VAR rStr: RString; rStrLength: INTEGER);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 826, $AA5C;
- (*$END*)
- (* Make a Pascal string from an RString. It's up to you to check the char set of
- the RString, or if the length of the RString is greater than 255 (the Pascal string's
- length will simply be the lower byte of the RString's length). The Types.StringPtr that is
- returned will point directly into the RString (no memory will be allocated). *)
- PROCEDURE OCERToPString*((*CONST*)VAR rStr: RString): Types.StringPtr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 827, $AA5C;
- (*$END*)
- (* Check the relative equality of two RStrings. Determines if str1 is greater than,
- equal to, or less than str2. Result types for OCERelRString are defined in <OSUtils.h>
- (same as for RelString). *)
- PROCEDURE OCERelRString*(str1: (*ΔΔUNIVΔΔ*) Types.Ptr; str2: (*ΔΔUNIVΔΔ*) Types.Ptr; kind: RStringKind): INTEGER;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 813, $AA5C;
- (*$END*)
- (* Check for equality of two RStrings. Returns true if equal. *)
- PROCEDURE OCEEqualRString*(str1: (*ΔΔUNIVΔΔ*) Types.Ptr; str2: (*ΔΔUNIVΔΔ*) Types.Ptr; kind: RStringKind): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 790, $AA5C;
- (*$END*)
- (* Check the validity of an RString. Returns true if the RString is valid *)
- PROCEDURE OCEValidRString*(str: (*ΔΔUNIVΔΔ*) Types.Ptr; kind: RStringKind): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 824, $AA5C;
- (*$END*)
- (**** CreationID ****)
-
- TYPE
- CreationID* = RECORD
- source*: LONGINT; (* Fields definitions and usage are not defined *)
- seq*: LONGINT;
- END;
-
- AttributeCreationID* = CreationID;
-
- (* Returns a pointer to a null CreationID . *)
-
- (*•• PROCEDURE OCENullCID*(): CreationID;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 836, $AA5C;
- (*$END*)*)
- (* Returns a pointer to a special CreationID used within the PathFinder. *)
- (*•• PROCEDURE OCEPathFinderCID*(): CreationID;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 828, $AA5C;
- (*$END*)*)
- (* Sets the CreationID to a null value. *)
- PROCEDURE OCESetCreationIDtoNull*(VAR cid: CreationID);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 814, $AA5C;
- (*$END*)
- (* Copies the value of cid1 to cid2. *)
- PROCEDURE OCECopyCreationID*((*CONST*)VAR cid1: CreationID; VAR cid2: CreationID);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 768, $AA5C;
- (*$END*)
- (* Check the equality of two CreationIDs. *)
- PROCEDURE OCEEqualCreationID*((*CONST*)VAR cid1: CreationID; (*CONST*)VAR cid2: CreationID): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 780, $AA5C;
- (*$END*)
- (**** NetworkSpec ****)
- (* For the record, a NetworkSpec is an RString with a smaller maximum size.
- I don't just typedef it to an RString, because I want the definition of the NetworkSpec
- struct to contain the max length. But it should be possible to typecast any
- NetworkSpec to an RString and use all the RString utilities on it. *)
-
- TYPE
- NetworkSpec* = RECORD
- charSet*: CharacterSet;
- dataLength*: INTEGER;
- body*: ARRAY (*ΔΔ[0..*)kNetworkSpecMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *) (* always fixed at the max size *)
- END;
-
- NetworkSpecPtr* = POINTER TO NetworkSpec;
-
- (**** PackedPathName ****)
- (* struct PackedPathName is a maximum-sized structure. Allocate one of
- these and it will hold any valid packed pathname. *)
- PackedPathName* = RECORD
- dataLength*: INTEGER;
- data*: ARRAY (*ΔΔ[0..*)kPathNameMaxBytes - 2(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
- END;
-
- (* struct ProtoPackedPathName is a minimum-sized structure. Use this
- for a variable-length packed PathName. *)
- ProtoPackedPathName* = RECORD
- dataLength*: INTEGER;
- END;
-
- PackedPathNamePtr* = POINTER TO PackedPathName;
-
- ProtoPackedPathNamePtr* = POINTER TO ProtoPackedPathName;
-
- (*
- Copy the contents of path1 to path2. path2Length is the size of path2, and must
- be large enough to hold a copy of path1. A memFull error will be returned if that
- is not the case.
- *)
-
- PROCEDURE OCECopyPackedPathName*((*CONST*)VAR path1: PackedPathName; VAR path2: PackedPathName; path2Length: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 772, $AA5C;
- (*$END*)
- (*
- Returns true if packed path pointer is nil, or is of zero length, or is of
- length 2 and nParts of zero.
- *)
- PROCEDURE OCEIsNullPackedPathName*((*CONST*)VAR path: PackedPathName): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 797, $AA5C;
- (*$END*)
- (*
- OCEUnpackPathName breaks apart the path into its component RStrings, writing string
- pointers into the array 'parts', which the client asserts can hold as many as
- 'nParts' elements. The number of parts actually found is returned. Strings are
- placed in the array in order from lowest to highest. The first pathName element
- beneath the root appears last. NOTE THAT THE UN(*ΔΔPACKEDΔΔ*) STRUCT CONTAINS POINTERS INTO
- THE (*ΔΔPACKEDΔΔ*) STRUCT - DON'T DELETE OR REUSE THE (*ΔΔPACKEDΔΔ*) STRUCT UNTIL YOU ARE FINISHED
- WITH THE UN(*ΔΔPACKEDΔΔ*) STRUCT AS WELL
- *)
- PROCEDURE OCEUnpackPathName*((*CONST*)VAR path: PackedPathName; VAR parts: RStringPtr; nParts: INTEGER): INTEGER;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 816, $AA5C;
- (*$END*)
- PROCEDURE OCEPackedPathNameSize*((*CONST*)VAR parts: RStringPtr; nParts: INTEGER): INTEGER;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 808, $AA5C;
- (*$END*)
- PROCEDURE OCEDNodeNameCount*((*CONST*)VAR path: PackedPathName): INTEGER;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 812, $AA5C;
- (*$END*)
- (*
- OCEPackPathName packs the parts into the storage provided as LONG("path"). path must be
- large enough to hold the packed pathname. A memFull error will be returned if
- pathLength is too small. parts[0] should contain the deepest pathName element,
- and parts[nParts - 1] should contain the name of the first pathName element beneath
- the root.
- *)
- PROCEDURE OCEPackPathName*(VAR parts: RStringPtr; nParts: INTEGER; VAR path: PackedPathName; pathLength: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 803, $AA5C;
- (*$END*)
- PROCEDURE OCEEqualPackedPathName*((*CONST*)VAR path1: PackedPathName; (*CONST*)VAR path2: PackedPathName): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 785, $AA5C;
- (*$END*)
- (*
- OCEValidPackedPathName checks that the packed PathName is internally consistent.
- Returns true if it's ok.
- *)
- PROCEDURE OCEValidPackedPathName*((*CONST*)VAR path: PackedPathName): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 820, $AA5C;
- (*$END*)
- (**** DirDiscriminator ****)
-
- TYPE
- DirDiscriminator* = RECORD
- signature*: OCEDirectoryKind;
- misc*: LONGINT;
- END;
-
- (* Copies the value of disc1 to disc2. *)
-
- PROCEDURE OCECopyDirDiscriminator*((*CONST*)VAR disc1: DirDiscriminator; VAR disc2: DirDiscriminator);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 769, $AA5C;
- (*$END*)
- (* Check the equality of two DirDiscriminators. *)
- PROCEDURE OCEEqualDirDiscriminator*((*CONST*)VAR disc1: DirDiscriminator; (*CONST*)VAR disc2: DirDiscriminator): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 781, $AA5C;
- (*$END*)
- (*
- This structure is called RLI because it really contains all the info you
- need to locate a record within the entire name space. It contains four fields.
- The first two are the name of the catalog and a catalog discriminator. These
- two fields are used to indicate to which catalog a given record belongs. The
- discriminator is used to distinguish between two different catalogs that have
- the same name.
-
- The other two fields in the RLI structure are used to indicate a particular
- catalog node within the catalog specified by the directoryName and
- discriminator fields. These fields are exactly analagous to the dirID and
- pathname used in HFS. It is possible to specify a dNode just by dNodeNumber
- (pathname is nil), or just by pathname (dNodeNumber is set to kNULLDNodeNumber),
- or by a combination of the two. The latter is called a 'partial pathname', and
- while it is valid in the Catalog Manager API, it is not supported by ADAP
- catalogs in Release 1.
-
- Note that the path parameter does not include the catalog name, but holds
- the names of all the nodes on the path to the desired catalog node, starting
- with the catalog node and working its way up the tree.
- *)
- (**** RLI ****)
-
- TYPE
- DirectoryName* = RECORD
- charSet*: CharacterSet;
- dataLength*: INTEGER;
- body*: ARRAY (*ΔΔ[0..*)kDirectoryNameMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *) (* space for catalog name *)
- END;
-
- DirectoryNamePtr* = POINTER TO DirectoryName;
-
- (* Catalog node number *)
- DNodeNum* = LONGINT;
-
- RLI* = RECORD
- directoryName*: DirectoryNamePtr; (* pointer to the name of the catalog root *)
- discriminator*: DirDiscriminator; (* used to discriminate between dup catalog names *)
- dNodeNumber*: DNodeNum; (* number of the node *)
- path*: PackedPathNamePtr; (* old-style RLI *)
- END;
-
- RLIPtr* = POINTER TO RLI;
-
- (*
- Create a new RLI from the catalog name, discriminator, DNode number, and
- PackedPathName. You must allocate the storage for the RLI and pass in a pointer
- to it.
- *)
-
- PROCEDURE OCENewRLI*(VAR newRLI: RLI; (*CONST*)VAR dirName: DirectoryName; VAR discriminator: DirDiscriminator; dNodeNumber: DNodeNum; (*CONST*)VAR path: PackedPathName);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 799, $AA5C;
- (*$END*)
- (*
- Duplicate the contents of rli1 to rli2. No errors are returned. This
- simply copies the pointers to the catalog name and path, wiping out any pointer
- that you might have had in there.
- *)
- PROCEDURE OCEDuplicateRLI*((*CONST*)VAR rli1: RLI; VAR rli2: RLI);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 779, $AA5C;
- (*$END*)
- (*
- Copy the contents of rli1 to rli2. rli2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from rli1. A memFull error will be returned if that is not the case.
- So if you allocate a brand new empty destination, you must at least set up
- its length fields.
- *)
- PROCEDURE OCECopyRLI*((*CONST*)VAR rli1: RLI; VAR rli2: RLI): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 775, $AA5C;
- (*$END*)
- (*
- Check the equality of two RLIs. This will take into account differences
- in the case and diacriticals of the directoryName and the PathName.
- NOTE THAT THIS WILL FAIL IF rli1 CONTAINS A DNODENUMBER AND A NIL PATHNAME,
- AND rli2 CONTAINS kNULLDNodeNumber AND A NON-NIL PATHNAME. IN OTHER WORDS,
- THE TWO rlis MUST BE OF THE SAME FORM TO CHECK FOR EQUALITY.
- The one exception is that if the pathname is nil, a dNodeNumber of zero and
- kRootDNodeNumber will be treated as equal.
- *)
- PROCEDURE OCEEqualRLI*((*CONST*)VAR rli1: RLI; (*CONST*)VAR rli2: RLI): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 789, $AA5C;
- (*$END*)
- (*
- Check the validity of an RLI. This checks that the catalog name length
- is within bounds, and the packed pathname (if specified) is valid.
- *)
- PROCEDURE OCEValidRLI*((*CONST*)VAR theRLI: RLI): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 823, $AA5C;
- (*$END*)
- (**** PackedRLI ****)
- (*
- struct PackedRLI is a maximum-sized structure. Allocate one of
- these and it will hold any valid packed pathname.
- *)
-
- CONST
- kRLIMaxBytes* = SIZE (*ΔΔ sizeof*)(RString) + SIZE (*ΔΔ sizeof*)(DirDiscriminator) + SIZE (*ΔΔ sizeof*)(DNodeNum) + kPathNameMaxBytes;
-
-
- TYPE
- PackedRLI* = RECORD
- dataLength*: INTEGER;
- data*: ARRAY (*ΔΔ[0..*)kRLIMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
- END;
-
- (*
- struct ProtoPackedRLI is a minimum-sized structure. Use this
- for a variable-length packed RLI.
- *)
- ProtoPackedRLI* = RECORD
- dataLength*: INTEGER;
- END;
-
- PackedRLIPtr* = POINTER TO PackedRLI;
-
- ProtoPackedRLIPtr* = POINTER TO ProtoPackedRLI;
-
- (*
- Copy the contents of prli1 to prli2. prli2Length is the size of prli2, and must
- be large enough to hold a copy of prli1. A memFull error will be returned if that
- is not the case.
- *)
-
- PROCEDURE OCECopyPackedRLI*((*CONST*)VAR prli1: PackedRLI; VAR prli2: PackedRLI; prli2Length: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 773, $AA5C;
- (*$END*)
- (*
- OCEUnpackRLI breaks apart the prli into its components, writing pointers into
- the rli structure. NOTE THAT THE UN(*ΔΔPACKEDΔΔ*) STRUCT CONTAINS POINTERS INTO THE
- (*ΔΔPACKEDΔΔ*) STRUCT - DON'T DELETE OR REUSE THE (*ΔΔPACKEDΔΔ*) STRUCT UNTIL YOU ARE FINISHED
- WITH THE UN(*ΔΔPACKEDΔΔ*) STRUCT AS WELL
- *)
- PROCEDURE OCEUnpackRLI*((*CONST*)VAR prli: PackedRLI; VAR theRLI: RLI);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 817, $AA5C;
- (*$END*)
- (*
- OCEPackedRLISize computes the number of bytes of memory needed to hold a
- PackedRLI manufactured from an RLI. This length
- includes the length of the length field of PackedRLI, so it
- is safe to do a NewPtr (OCEPackedRLISize(...)).
- *)
- PROCEDURE OCEPackedRLISize*((*CONST*)VAR theRLI: RLI): INTEGER;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 810, $AA5C;
- (*$END*)
- (*
- OCEPackRLI packs the RLI into the storage provided as LONG("prli"). prli must be
- large enough to hold the packed RLI. A memFull error will be returned if
- prliLength is too small.
- *)
- PROCEDURE OCEPackRLI*((*CONST*)VAR theRLI: RLI; VAR prli: PackedRLI; prliLength: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 804, $AA5C;
- (*$END*)
- (*
- OCEPackedRLIPartsSize computes the number of bytes of memory needed to hold a
- PackedRLI manufactured from the parts of an RLI. This length
- includes the length of the length field of PackedRLI, so it
- is safe to do a NewPtr (OCEPackedRLIPartsSize(...)).
- *)
- PROCEDURE OCEPackedRLIPartsSize*((*CONST*)VAR dirName: DirectoryName; VAR parts: RStringPtr; nParts: INTEGER): INTEGER;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 809, $AA5C;
- (*$END*)
- PROCEDURE OCEPackRLIParts*((*CONST*)VAR dirName: DirectoryName; (*CONST*)VAR discriminator: DirDiscriminator; dNodeNumber: DNodeNum; VAR parts: RStringPtr; nParts: INTEGER; VAR prli: PackedRLI; prliLength: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 805, $AA5C;
- (*$END*)
- PROCEDURE OCEEqualPackedRLI*((*CONST*)VAR prli1: PackedRLI; (*CONST*)VAR prli2: PackedRLI): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 787, $AA5C;
- (*$END*)
- (*
- Check the validity of a packed RLI. This checks that the catalog name length
- is within bounds, and the packed pathname (if specified) is valid.
- *)
- PROCEDURE OCEValidPackedRLI*((*CONST*)VAR prli: PackedRLI): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 822, $AA5C;
- (*$END*)
- (*
- If this packed RLI describes a Personal Catalog, this call will return a pointer
- to an alias record that can be used to find the actual file. Otherwise, it returns nil.
- *)
- PROCEDURE OCEExtractAlias*((*CONST*)VAR prli: PackedRLI): Aliases.AliasPtr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 792, $AA5C;
- (*$END*)
- (*
- This call returns a pointer to a packed RLI that represents the "Catalogs" icon, or
- the root of all catalogs. It is used in the CollabPack.
- *)
- (*•• PROCEDURE OCEGetDirectoryRootPackedRLI*(): PackedRLI;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 838, $AA5C;
- (*$END*)*)
- (**** LocalRecordID ****)
-
- TYPE
- LocalRecordID* = RECORD
- cid*: CreationID;
- recordName*: RStringPtr;
- recordType*: RStringPtr;
- END;
-
- LocalRecordIDPtr* = POINTER TO LocalRecordID;
-
- (* Create a LocalRecordID from a name, type, and CreationID *)
-
- PROCEDURE OCENewLocalRecordID*((*CONST*)VAR recordName: RString; (*CONST*)VAR recordType: RString; (*CONST*)VAR cid: CreationID; VAR lRID: LocalRecordID);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 798, $AA5C;
- (*$END*)
- (*
- Copy LocalRecordID lRID1 to LocalRecordID lRID2. lRID2 must already contain
- pointers to RString structures large enough to hold copies of the corresponding
- fields from lRID1. A memFull error will be returned if that is not the case.
- So if you allocate a brand new empty destination, you must at least set up
- its length field.
- *)
- PROCEDURE OCECopyLocalRecordID*((*CONST*)VAR lRID1: LocalRecordID; VAR lRID2: LocalRecordID): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 770, $AA5C;
- (*$END*)
- (*
- Check the equality of two local RIDs.
- *)
- PROCEDURE OCEEqualLocalRecordID*((*CONST*)VAR lRID1: LocalRecordID; (*CONST*)VAR lRID2: LocalRecordID): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 783, $AA5C;
- (*$END*)
- (**** ShortRecordID ****)
-
- TYPE
- ShortRecordID* = RECORD
- rli*: PackedRLIPtr;
- cid*: CreationID;
- END;
-
- ShortRecordIDPtr* = POINTER TO ShortRecordID;
-
- (* Create a ShortRecordID from an RLI struct and a CreationID *)
-
- PROCEDURE OCENewShortRecordID*((*CONST*)VAR theRLI: PackedRLI; (*CONST*)VAR cid: CreationID; sRID: ShortRecordIDPtr);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 801, $AA5C;
- (*$END*)
- (*
- Copy ShortRecordID sRID1 to ShortRecordID sRID2. sRID2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from sRID1. A memFull error will be returned if that is not the case.
- So if you allocate a brand new empty destination, you must at least set up
- its length fields.
- *)
- PROCEDURE OCECopyShortRecordID*((*CONST*)VAR sRID1: ShortRecordID; VAR sRID2: ShortRecordID): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 778, $AA5C;
- (*$END*)
- (*
- Check the equality of two short RIDs.
- *)
- PROCEDURE OCEEqualShortRecordID*((*CONST*)VAR sRID1: ShortRecordID; (*CONST*)VAR sRID2: ShortRecordID): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 791, $AA5C;
- (*$END*)
- (**** RecordID ****)
-
- TYPE
- RecordID* = RECORD
- rli*: PackedRLIPtr; (* pointer to a packed rli structure *)
- local*: LocalRecordID;
- END;
-
- RecordIDPtr* = POINTER TO RecordID;
-
- (* Create a RecordID from a packed RLI struct and a LocalRecordID.
- This doesn't allocate any new space; the RecordID points to the same
- packed RLI struct and the same name and type RStrings. *)
-
- PROCEDURE OCENewRecordID*((*CONST*)VAR theRLI: PackedRLI; (*CONST*)VAR lRID: LocalRecordID; VAR rid: RecordID);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 800, $AA5C;
- (*$END*)
- (*
- Copy RecordID RID1 to RecordID RID2. RID2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from lRID1. A memFull error will be returned if that is not the case.
- So if you allocate a brand new empty destination, you must at least set up
- its length fields.
- *)
- PROCEDURE OCECopyRecordID*((*CONST*)VAR rid1: RecordID; (*CONST*)VAR rid2: RecordID): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 777, $AA5C;
- (*$END*)
- (* Check the equality of two RIDs. *)
- PROCEDURE OCEEqualRecordID*((*CONST*)VAR rid1: RecordID; (*CONST*)VAR rid2: RecordID): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 788, $AA5C;
- (*$END*)
- (**** PackedRecordID ****)
- (*
- struct PackedRecordID is a maximum-sized structure. Allocate one of
- these and it will hold any valid packed RecordID.
- *)
-
- CONST
- kPackedRecordIDMaxBytes* = kPathNameMaxBytes + SIZE (*ΔΔ sizeof*)(DNodeNum) + SIZE (*ΔΔ sizeof*)(DirDiscriminator) + SIZE (*ΔΔ sizeof*)(CreationID) + (3 * SIZE (*ΔΔ sizeof*)(RString));
-
-
- TYPE
- PackedRecordID* = RECORD
- dataLength*: INTEGER;
- data*: ARRAY (*ΔΔ[0..*)kPackedRecordIDMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
- END;
-
- (*
- struct ProtoPackedRecordID is a minimum-sized structure. Use this
- for a variable-length packed RecordID.
- *)
- ProtoPackedRecordID* = RECORD
- dataLength*: INTEGER;
- END;
-
- PackedRecordIDPtr* = POINTER TO PackedRecordID;
-
- ProtoPackedRecordIDPtr* = POINTER TO ProtoPackedRecordID;
-
- (*
- Copy PackedRecordID pRID1 to PackedRecordID pRID2. pRID2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from pRID1. A memFull error will be returned if that is not the case.
- pRID2Length is the number of bytes that can be put into pRID2, not counting the
- packed RecordID header.
- *)
-
- PROCEDURE OCECopyPackedRecordID*((*CONST*)VAR pRID1: PackedRecordID; (*CONST*)VAR pRID2: PackedRecordID; pRID2Length: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 774, $AA5C;
- (*$END*)
- (*
- Create a RecordID from a PackedRecordID.
- NOTE THAT THE UN(*ΔΔPACKEDΔΔ*) STRUCT CONTAINS POINTERS INTO THE (*ΔΔPACKEDΔΔ*) STRUCT - DON'T DELETE
- OR REUSE THE (*ΔΔPACKEDΔΔ*) STRUCT UNTIL YOU ARE FINISHED WITH THE UN(*ΔΔPACKEDΔΔ*) STRUCT AS WELL
- *)
- PROCEDURE OCEUnpackRecordID*((*CONST*)VAR pRID: PackedRecordID; VAR rid: RecordID);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 818, $AA5C;
- (*$END*)
- (*
- Create a PackedRecordID from a RecordID. pRID must be large enough to contain
- the packed RecordID. A memFull error will be returned if that is not the case.
- packedRecordIDLength is the number of bytes that can be put into pRID, not
- counting the header.
- *)
- PROCEDURE OCEPackRecordID*((*CONST*)VAR rid: RecordID; VAR pRID: PackedRecordID; packedRecordIDLength: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 806, $AA5C;
- (*$END*)
- (*
- Compute the number of bytes of memory needed to hold a RecordID when packed. This
- length includes the length of the length field of PackedRecordID, so it
- is safe to do a NewPtr (OCEPackedRecordIDSize(...)).
- *)
- PROCEDURE OCEPackedRecordIDSize*((*CONST*)VAR rid: RecordID): INTEGER;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 811, $AA5C;
- (*$END*)
- (*
- Check the equality of two packed RIDs.
- *)
- PROCEDURE OCEEqualPackedRecordID*((*CONST*)VAR pRID1: PackedRecordID; (*CONST*)VAR pRID2: PackedRecordID): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 786, $AA5C;
- (*$END*)
- (* OCEValidPackedRecordID checks the validity of a packed record AIFF.ID. *)
- PROCEDURE OCEValidPackedRecordID*((*CONST*)VAR pRID: PackedRecordID): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 821, $AA5C;
- (*$END*)
- (**** DSSpec ****)
-
- TYPE
- DSSpec* = RECORD
- entitySpecifier*: POINTER TO RecordID;
- extensionType*: Types.OSType;
- extensionSize*: INTEGER;
- extensionValue*: Types.Ptr;
- END;
-
- DSSpecPtr* = POINTER TO DSSpec;
-
- (*
- struct PackedDSSpec is NOT a maximum-sized structure. Allocate one of
- these and it will hold any valid packed RecordID, but not necessarily any additional
- data.
- *)
-
- CONST
- kPackedDSSpecMaxBytes* = SIZE (*ΔΔ sizeof*)(PackedRecordID) + SIZE (*ΔΔ sizeof*)(Types.OSType) + SIZE (*ΔΔ sizeof*)(Types.UInt16);
-
-
- TYPE
- PackedDSSpec* = RECORD
- dataLength*: INTEGER;
- data*: ARRAY (*ΔΔ[0..*)kPackedDSSpecMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *)
- END;
-
- (*
- struct ProtoPackedDSSpec is a minimum-sized structure. Use this
- for a variable-length packed DSSpec.
- *)
- ProtoPackedDSSpec* = RECORD
- dataLength*: INTEGER;
- END;
-
- PackedDSSpecPtr* = POINTER TO PackedDSSpec;
-
- ProtoPackedDSSpecPtr* = POINTER TO ProtoPackedDSSpec;
-
- (*
- Copy PackedDSSpec pdss1 to PackedDSSpec pdss2. pdss2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from pdss1. A memFull error will be returned if that is not the case.
- pdss2Length is the number of bytes that can be put into pdss2, not counting the
- packed DSSpec header.
- *)
-
- PROCEDURE OCECopyPackedDSSpec*((*CONST*)VAR pdss1: PackedDSSpec; (*CONST*)VAR pdss2: PackedDSSpec; pdss2Length: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 771, $AA5C;
- (*$END*)
- (*
- Create a DSSpec from a PackedDSSpec.
- NOTE THAT THE UN(*ΔΔPACKEDΔΔ*) STRUCT CONTAINS POINTERS INTO THE (*ΔΔPACKEDΔΔ*) STRUCT - DON'T DELETE
- OR REUSE THE (*ΔΔPACKEDΔΔ*) STRUCT UNTIL YOU ARE FINISHED WITH THE UN(*ΔΔPACKEDΔΔ*) STRUCT AS WELL.
- A pointer to the extension is returned in dss->extensionValue, and the length of that
- extension is returned in dss->extensionSize. If there is no extension, dss->extensionValue will
- be set to nil. This routine will unpack the RecordID (if any) into rid, unpack the rest
- into dss, and set dss->entitySpecifier to rid.
- *)
- PROCEDURE OCEUnpackDSSpec*((*CONST*)VAR pdss: PackedDSSpec; VAR dss: DSSpec; VAR rid: RecordID);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 815, $AA5C;
- (*$END*)
- (*
- Create a PackedDSSpec from a DSSpec. pdss must be large enough to
- contain the packed RecordID and any extension. A memFull error will be returned if that
- is not the case. pdssLength is the number of bytes that can be put into pdss,
- not counting the header.
- *)
- PROCEDURE OCEPackDSSpec*((*CONST*)VAR dss: DSSpec; VAR pdss: PackedDSSpec; pdssLength: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 802, $AA5C;
- (*$END*)
- (*
- Compute the number of bytes of memory needed to hold a DSSpec when packed. This
- length includes the length of the length field of PackedDSSpec, so it
- is safe to do a NewPtr (OCEPackedDSSpecSize(...)).
- *)
- PROCEDURE OCEPackedDSSpecSize*((*CONST*)VAR dss: DSSpec): INTEGER;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 807, $AA5C;
- (*$END*)
- (* Check the equality of two DSSpecs. This compares all fields, even the
- extension (unless extensionSize == 0). The extensions are compared in a case-insensitive and
- diacrit-insensitive manner. *)
- PROCEDURE OCEEqualDSSpec*((*CONST*)VAR pdss1: DSSpec; (*CONST*)VAR pdss2: DSSpec): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 782, $AA5C;
- (*$END*)
- (* Check the equality of two PackedDSSpecs. This compares all fields, even the
- extension (unless extensionSize == 0). The extensions are compared in a case-insensitive and
- diacrit-insensitive manner. *)
- PROCEDURE OCEEqualPackedDSSpec*((*CONST*)VAR pdss1: PackedDSSpec; (*CONST*)VAR pdss2: PackedDSSpec): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 784, $AA5C;
- (*$END*)
- (*
- Check the validity of a PackedDSSpec. If extensionType is
- LONG("entn"), pdss must contain a valid entitySpecifier. For all other extensionTypes, a nil
- entitySpecifier is valid, but if non-nil, it will be checked for validity. No check
- is made on the extension.
- *)
- PROCEDURE OCEValidPackedDSSpec*((*CONST*)VAR pdss: PackedDSSpec): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 819, $AA5C;
- (*$END*)
- (*
- Return info about a DSSpec. This routine does not check validity. If the
- DSSpec has no extension, we determine whether it represents the root of all
- catalogs, a single catalog, a DNode, or a Record. Else it is invalid.
- If the DSSpec has an extension, we simply return the extension type.
- *)
- PROCEDURE OCEGetDSSpecInfo*((*CONST*)VAR spec: DSSpec): Types.OSType;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 793, $AA5C;
- (*$END*)
- (* OCEGetExtensionType returns the extensionType imbedded in the PackedDSSpec. *)
- PROCEDURE OCEGetExtensionType*((*CONST*)VAR pdss: PackedDSSpec): Types.OSType;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 796, $AA5C;
- (*$END*)
- (*
- OCEStreamPackedDSSpec streams (flattens) a catalog object a little at a time by
- calling the DSSpecStreamer routine that you provide.
- *)
- TYPE
- DSSpecStreamerProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (buffer: (*ΔΔUNIVΔΔ*) Types.Ptr; count: LONGINT; eof: BOOLEAN; userData: LONGINT): Types.OSErr;
- DSSpecStreamerUPP* = Types.UniversalProcPtr;
-
- CONST
- uppDSSpecStreamerProcInfo* = $000037E0; (* PROCEDURE (4 byte param, 4 byte param, 1 byte param, 4 byte param): 2 byte result; *)
-
- PROCEDURE NewDSSpecStreamerProc*(userRoutine: DSSpecStreamerProcPtr): DSSpecStreamerUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE CallDSSpecStreamerProc*(buffer: (*ΔΔUNIVΔΔ*) Types.Ptr; count: LONGINT; eof: BOOLEAN; userData: LONGINT; userRoutine: DSSpecStreamerUPP): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- TYPE
- DSSpecStreamer* = DSSpecStreamerUPP;
-
-
- PROCEDURE OCEStreamPackedDSSpec*((*CONST*)VAR dss: DSSpec; stream: DSSpecStreamer; userData: LONGINT; VAR actualCount: LONGINT): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 829, $AA5C;
- (*$END*)
- (**** AttributeType ****)
- (*
- For the record, an AttributeType is an RString with a smaller maximum size.
- I don't just typedef it to an RString, because I want the definition of the AttributeType
- struct to contain the max length, because I need to include it in the Attribute struct
- below. But it should be possible to typecast any AttributeType to an RString and use
- all the RString utilities on it.
- *)
-
- TYPE
- AttributeType* = RECORD
- charSet*: CharacterSet;
- dataLength*: INTEGER;
- body*: ARRAY (*ΔΔ[0..*)kAttributeTypeMaxBytes(*ΔΔ -1]ΔΔ*) OF Types.SInt8; (* Types.Byte *) (* always fixed at the max size *)
- END;
-
- AttributeTypePtr* = POINTER TO AttributeType;
-
- (* Miscellaneous defines*: (these cannot be made into enums) *)
-
- CONST
- kMinPackedRStringLength* = SIZE (*ΔΔ sizeof*)(ProtoRString);
-
- kMinPackedRLISize* = SIZE (*ΔΔ sizeof*)(ProtoPackedRLI) + SIZE (*ΔΔ sizeof*)(DirDiscriminator) + SIZE (*ΔΔ sizeof*)(DNodeNum) + kMinPackedRStringLength + SIZE (*ΔΔ sizeof*)(ProtoPackedPathName);
-
-
- TYPE
- AttributeTag* = AppleEvents.DescType;
-
- AttributeValue* = RECORD
- tag*: AttributeTag;
- dataLength*: LONGINT;
- bytes*: Types.Ptr;
- END;
-
- AttributeValuePtr* = POINTER TO AttributeValue;
-
- (**** Attribute ****)
- Attribute* = RECORD
- attributeType*: AttributeType;
- cid*: AttributeCreationID;
- value*: AttributeValue;
- END;
-
- AttributePtr* = POINTER TO Attribute;
-
-
- (*•• PROCEDURE OCEGetIndRecordType*(stringIndex: OCERecordTypeIndex): RString;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 795, $AA5C;
- (*$END*)*)
- (*•• PROCEDURE OCEGetIndAttributeType*(stringIndex: OCEAttributeTypeIndex): AttributeType;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, 794, $AA5C;
- (*$END*)*)
-
- CONST
- _oceTBDispatch* = $AA5E;
-
-
- (* $ALIGN RESET*)
- (* $POP*)
-
- END OCE.
-